package com.ddzh.mapper;

import com.ddzh.pojo.Order;
import com.ddzh.pojo.User;
import com.ddzh.vo.UserOrderVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {
    /**
     * 根据用户名 查询 用户名和 订单详情
     * @param username
     * @return
     */
//    @Select("SELECT u.username,o.*\n" +
//            "FROM tb_user u LEFT JOIN tb_order o ON o.username = u.username\n" +
//            "WHERE u.username = #{username}")
    @Select("SELECT * FROM tb_order WHERE username = #{username}")
    List<Order> findOrderByUserId(@Param("username")String username);
}
